home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / StandardFile.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  7.6 KB  |  251 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        StandardFile.a
  3. ;
  4. ;    Contains:    Standard File package Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1990-1995, 1997-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__STANDARDFILE__') = 'UNDEFINED' THEN
  19. __STANDARDFILE__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  25.     include 'Dialogs.a'
  26.     ENDIF
  27.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  28.     include 'Files.a'
  29.     ENDIF
  30.  
  31.  
  32.                                                             ; resource IDs of pre-7.0 get and put dialogs 
  33. putDlgID                        EQU        -3999
  34. getDlgID                        EQU        -4000
  35.  
  36.                                                             ; item offsets of pre-7.0 get and put dialogs 
  37. putSave                            EQU        1
  38. putCancel                        EQU        2
  39. putEject                        EQU        5
  40. putDrive                        EQU        6
  41. putName                            EQU        7
  42. getOpen                            EQU        1
  43. getCancel                        EQU        3
  44. getEject                        EQU        5
  45. getDrive                        EQU        6
  46. getNmList                        EQU        7
  47. getScroll                        EQU        8
  48.  
  49.                                                             ; resource IDs of 7.0 get and put dialogs 
  50. sfPutDialogID                    EQU        -6043
  51. sfGetDialogID                    EQU        -6042
  52.  
  53.                                                             ; item offsets of 7.0 get and put dialogs 
  54. sfItemOpenButton                EQU        1
  55. sfItemCancelButton                EQU        2
  56. sfItemBalloonHelp                EQU        3
  57. sfItemVolumeUser                EQU        4
  58. sfItemEjectButton                EQU        5
  59. sfItemDesktopButton                EQU        6
  60. sfItemFileListUser                EQU        7
  61. sfItemPopUpMenuUser                EQU        8
  62. sfItemDividerLinePict            EQU        9
  63. sfItemFileNameTextEdit            EQU        10
  64. sfItemPromptStaticText            EQU        11
  65. sfItemNewFolderUser                EQU        12
  66.  
  67.                                                             ; pseudo-item hits for use in DlgHook 
  68. sfHookFirstCall                    EQU        -1
  69. sfHookCharOffset                EQU        $1000
  70. sfHookNullEvent                    EQU        100
  71. sfHookRebuildList                EQU        101
  72. sfHookFolderPopUp                EQU        102
  73. sfHookOpenFolder                EQU        103                    ; the following are only in system 7.0+ 
  74. sfHookLastCall                    EQU        -2
  75. sfHookOpenAlias                    EQU        104
  76. sfHookGoToDesktop                EQU        105
  77. sfHookGoToAliasTarget            EQU        106
  78. sfHookGoToParent                EQU        107
  79. sfHookGoToNextDrive                EQU        108
  80. sfHookGoToPrevDrive                EQU        109
  81. sfHookChangeSelection            EQU        110
  82. sfHookSetActiveOffset            EQU        200
  83.  
  84. ;  the refcon field of the dialog record during a
  85. ; modalfilter or dialoghook contains one of the following 
  86.  
  87. sfMainDialogRefCon                EQU        'stdf'
  88. sfNewFolderDialogRefCon            EQU        'nfdr'
  89. sfReplaceDialogRefCon            EQU        'rplc'
  90. sfStatWarnDialogRefCon            EQU        'stat'
  91. sfLockWarnDialogRefCon            EQU        'lock'
  92. sfErrorDialogRefCon                EQU        'err '
  93.  
  94. SFReply                    RECORD 0
  95. good                     ds.b    1                ; offset: $0 (0)
  96. copy                     ds.b    1                ; offset: $1 (1)
  97. fType                     ds.l    1                ; offset: $2 (2)
  98. vRefNum                     ds.w    1                ; offset: $6 (6)
  99. version                     ds.w    1                ; offset: $8 (8)
  100. fName                     ds        StrFileName        ; offset: $A (10)        ;  a Str63 on MacOS 
  101. sizeof                     EQU *                    ; size:   $4A (74)
  102.                         ENDR
  103. StandardFileReply        RECORD 0
  104. sfGood                     ds.b    1                ; offset: $0 (0)
  105. sfReplacing                 ds.b    1                ; offset: $1 (1)
  106. sfType                     ds.l    1                ; offset: $2 (2)
  107. sfFile                     ds        FSSpec            ; offset: $6 (6)
  108. sfScript                 ds.w    1                ; offset: $4C (76)
  109. sfFlags                     ds.w    1                ; offset: $4E (78)
  110. sfIsFolder                 ds.b    1                ; offset: $50 (80)
  111. sfIsVolume                 ds.b    1                ; offset: $51 (81)
  112. sfReserved1                 ds.l    1                ; offset: $52 (82)
  113. sfReserved2                 ds.w    1                ; offset: $56 (86)
  114. sizeof                     EQU *                    ; size:   $58 (88)
  115.                         ENDR
  116. ;  for CustomXXXFile, ActivationOrderListPtr parameter is a pointer to an array of item numbers 
  117. ; typedef const short *                    ActivationOrderListPtr
  118.  
  119. ;  the following also include an extra parameter of "your data pointer" 
  120. SFTypeList                RECORD 0
  121. elements                 ds.l    4
  122. sizeof                     EQU *                    ; size:   $10 (16)
  123.                         ENDR
  124.  
  125.  
  126. ;    The GetFile "typeList" parameter type has changed from "SFTypeList" to "ConstSFTypeListPtr".
  127. ;    For C, this will add "const" and make it an in-only parameter.
  128. ;    For Pascal, this will require client code to use the @ operator, but make it easier to specify long lists.
  129. ;
  130. ;    ConstSFTypeListPtr is a pointer to an array of OSTypes.
  131. ;
  132.  
  133. ; typedef const OSType *                ConstSFTypeListPtr
  134.  
  135.  
  136. ;
  137. ; pascal void SFPutFile(Point where, ConstStr255Param prompt, ConstStr255Param origName, DlgHookUPP dlgHook, SFReply *reply)
  138. ;
  139.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  140.         Macro
  141.         _SFPutFile
  142.             move.w              #$0001,-(sp)
  143.             dc.w                $A9EA
  144.         EndM
  145.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  146.         IMPORT_CFM_FUNCTION SFPutFile
  147.     ENDIF
  148.  
  149. ;
  150. ; pascal void SFGetFile(Point where, ConstStr255Param prompt, FileFilterUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, DlgHookUPP dlgHook, SFReply *reply)
  151. ;
  152.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  153.         Macro
  154.         _SFGetFile
  155.             move.w              #$0002,-(sp)
  156.             dc.w                $A9EA
  157.         EndM
  158.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  159.         IMPORT_CFM_FUNCTION SFGetFile
  160.     ENDIF
  161.  
  162. ;
  163. ; pascal void SFPPutFile(Point where, ConstStr255Param prompt, ConstStr255Param origName, DlgHookUPP dlgHook, SFReply *reply, short dlgID, ModalFilterUPP filterProc)
  164. ;
  165.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  166.         Macro
  167.         _SFPPutFile
  168.             move.w              #$0003,-(sp)
  169.             dc.w                $A9EA
  170.         EndM
  171.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  172.         IMPORT_CFM_FUNCTION SFPPutFile
  173.     ENDIF
  174.  
  175. ;
  176. ; pascal void SFPGetFile(Point where, ConstStr255Param prompt, FileFilterUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, DlgHookUPP dlgHook, SFReply *reply, short dlgID, ModalFilterUPP filterProc)
  177. ;
  178.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  179.         Macro
  180.         _SFPGetFile
  181.             move.w              #$0004,-(sp)
  182.             dc.w                $A9EA
  183.         EndM
  184.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  185.         IMPORT_CFM_FUNCTION SFPGetFile
  186.     ENDIF
  187.  
  188. ;
  189. ; pascal void StandardPutFile(ConstStr255Param prompt, ConstStr255Param defaultName, StandardFileReply *reply)
  190. ;
  191.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  192.         Macro
  193.         _StandardPutFile
  194.             move.w              #$0005,-(sp)
  195.             dc.w                $A9EA
  196.         EndM
  197.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  198.         IMPORT_CFM_FUNCTION StandardPutFile
  199.     ENDIF
  200.  
  201. ;
  202. ; pascal void StandardGetFile(FileFilterUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, StandardFileReply *reply)
  203. ;
  204.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  205.         Macro
  206.         _StandardGetFile
  207.             move.w              #$0006,-(sp)
  208.             dc.w                $A9EA
  209.         EndM
  210.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  211.         IMPORT_CFM_FUNCTION StandardGetFile
  212.     ENDIF
  213.  
  214. ;
  215. ; pascal void CustomPutFile(ConstStr255Param prompt, ConstStr255Param defaultName, StandardFileReply *reply, short dlgID, Point where, DlgHookYDUPP dlgHook, ModalFilterYDUPP filterProc, ActivationOrderListPtr activeList, ActivateYDUPP activate, void *yourDataPtr)
  216. ;
  217.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  218.         Macro
  219.         _CustomPutFile
  220.             move.w              #$0007,-(sp)
  221.             dc.w                $A9EA
  222.         EndM
  223.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  224.         IMPORT_CFM_FUNCTION CustomPutFile
  225.     ENDIF
  226.  
  227. ;
  228. ; pascal void CustomGetFile(FileFilterYDUPP fileFilter, short numTypes, ConstSFTypeListPtr typeList, StandardFileReply *reply, short dlgID, Point where, DlgHookYDUPP dlgHook, ModalFilterYDUPP filterProc, ActivationOrderListPtr activeList, ActivateYDUPP activate, void *yourDataPtr)
  229. ;
  230.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  231.         Macro
  232.         _CustomGetFile
  233.             move.w              #$0008,-(sp)
  234.             dc.w                $A9EA
  235.         EndM
  236.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  237.         IMPORT_CFM_FUNCTION CustomGetFile
  238.     ENDIF
  239.  
  240. ;
  241. ; pascal OSErr StandardOpenDialog(StandardFileReply *reply)
  242. ;
  243.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  244.         IMPORT_CFM_FUNCTION StandardOpenDialog
  245.     ENDIF
  246.  
  247.  
  248.     ENDIF ; __STANDARDFILE__ 
  249.  
  250.